home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxband.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.5 KB  |  93 lines

  1. /* Copyright (C) 1997, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxband.h,v 1.2 2000/09/19 19:00:33 lpd Exp $ */
  20. /* Band-processing parameters for Ghostscript */
  21.  
  22. #ifndef gxband_INCLUDED
  23. #  define gxband_INCLUDED
  24.  
  25. #include "gxclio.h"
  26.  
  27. /*
  28.  * Define the parameters controlling banding.
  29.  */
  30. typedef struct gx_band_params_s {
  31.     int BandWidth;        /* (optional) band width in pixels */
  32.     int BandHeight;        /* (optional) */
  33.     long BandBufferSpace;    /* (optional) */
  34. } gx_band_params_t;
  35.  
  36. #define BAND_PARAMS_INITIAL_VALUES 0, 0, 0
  37.  
  38. /*
  39.  * Define information about the colors used on a page.
  40.  */
  41. typedef struct gx_colors_used_s {
  42.     gx_color_index or;        /* the "or" of all the used colors */
  43.     bool slow_rop;        /* true if any RasterOps that can't be */
  44.                 /* executed plane-by-plane on CMYK devices */
  45. } gx_colors_used_t;
  46.  
  47. /*
  48.  * We want to store color usage information for each band in the page_info
  49.  * structure, but we also want this structure to be of a fixed (and
  50.  * reasonable) size.  We do this by allocating a fixed number of colors_used
  51.  * structures in the page_info structure, and if there are more bands than
  52.  * we have allocated, we simply reduce the precision of the information by
  53.  * letting each colors_used structure cover multiple bands.
  54.  *
  55.  * 30 entries would be large enough to cover A4 paper (11.3") at 600 dpi
  56.  * with 256-scan-line bands.  We pick 50 somewhat arbitrarily.
  57.  */
  58. #define PAGE_INFO_NUM_COLORS_USED 50
  59.  
  60. /*
  61.  * Define the information for a saved page.
  62.  */
  63. typedef struct gx_band_page_info_s {
  64.     char cfname[gp_file_name_sizeof];    /* command file name */
  65.     clist_file_ptr cfile;    /* command file, normally 0 */
  66.     char bfname[gp_file_name_sizeof];    /* block file name */
  67.     clist_file_ptr bfile;    /* block file, normally 0 */
  68.     uint tile_cache_size;    /* size of tile cache */
  69.     long bfile_end_pos;        /* ftell at end of bfile */
  70.     gx_band_params_t band_params;  /* parameters used when writing band list */
  71.                 /* (actual values, no 0s) */
  72.     int scan_lines_per_colors_used; /* number of scan lines per colors_used */
  73.                 /* entry (a multiple of the band height) */
  74.     gx_colors_used_t band_colors_used[PAGE_INFO_NUM_COLORS_USED];  /* colors used on the page */
  75. } gx_band_page_info_t;
  76. #define PAGE_INFO_NULL_VALUES\
  77.   { 0 }, 0, { 0 }, 0, 0, 0, { BAND_PARAMS_INITIAL_VALUES },\
  78.   0x3fffffff, { { 0 } }
  79.  
  80. /*
  81.  * By convention, the structure member containing the above is called
  82.  * page_info.  Define shorthand accessors for its members.
  83.  */
  84. #define page_cfile page_info.cfile
  85. #define page_cfname page_info.cfname
  86. #define page_bfile page_info.bfile
  87. #define page_bfname page_info.bfname
  88. #define page_tile_cache_size page_info.tile_cache_size
  89. #define page_bfile_end_pos page_info.bfile_end_pos
  90. #define page_band_height page_info.band_params.BandHeight
  91.  
  92. #endif /* ndef gxband_INCLUDED */
  93.